package com.gw.smscheck.service.business.positionInfo.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.gw.smscheck.dao.business.positionInfo.PositionInfoMapper;
import com.gw.smscheck.entity.business.positionInfo.PositionInfo;
import com.gw.smscheck.entity.business.positionInfo.PositionTrajectory;
import com.gw.smscheck.service.business.positionInfo.PositionInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class PositionInfoServiceImpl implements PositionInfoService {
	@Autowired
	private PositionInfoMapper positionInfoMapper;
	@Override
	public Integer add(PositionInfo positionInfo) {
		return positionInfoMapper.add(positionInfo);
	}
	@Override
	public List<PositionInfo> findAll() {
		return positionInfoMapper.findAll();
	}
	@Override
	public PageInfo<PositionInfo> pageSelect(PositionInfo dto) {
		PageHelper.startPage(dto.getPage(), dto.getRows(), "create_time desc");// 排序
		List<PositionInfo> resultList = positionInfoMapper.pageSelect(dto);
		PageInfo<PositionInfo> pageInfo = new PageInfo<>(resultList);
		return pageInfo;
	}
	@Override
	public PositionInfo findById(Integer dto) {
		return positionInfoMapper.findById(dto);
	}
	@Override
	public Integer update(PositionInfo positionInfo) {
		return positionInfoMapper.update(positionInfo);
	}
	@Override
	public Integer delByIds(String[] ids) {
		return positionInfoMapper.delByIds(ids);
	}

    @Override
    public List<PositionInfo> findPositionInfo(PositionInfo dto) {
        return positionInfoMapper.findPositionInfo(dto);
    }

	@Override
	public PositionTrajectory getNewByPhone(String phone) {
		return positionInfoMapper.getNewByPhone(phone);
	}

	@Override
	public Integer updateLastTimeForTrajectory(PositionTrajectory positionInfo) {
		return positionInfoMapper.updateLastTimeForTrajectory(positionInfo);
	}

	@Override
	public Integer addTrajectory(PositionInfo obj) {
		return positionInfoMapper.addTrajectory(obj);
	}
}

